home *** CD-ROM | disk | FTP | other *** search
/ The AGA Experience 3 / AGA Experience Volume 3 (1997)(NFA - SAdENESS)[!].iso / amiga / docs / _getdir.rexx next >
OS/2 REXX Batch file  |  1996-09-06  |  1KB  |  42 lines

  1. /* Sample ARexx script to get the directory of a selected drawer, and
  2.    load the result back into the AWeb window */
  3.  
  4. /* Get the arguments in a string */
  5. parse arg arguments
  6.  
  7. /* Initialize the individual parameters */
  8. drawer = ''
  9. dirsopt = ''
  10. allopt = ''
  11.  
  12. /* Now, get each individual DOS-style argument */
  13. do forever
  14.    parse var arguments nextarg arguments
  15.  
  16.    /* Leave the iteration after the last argument */
  17.    if nextarg == '' then leave
  18.  
  19.    /* Now the variable nextarg contains a DOS-style argument of the form
  20.       name="value". Use this to set the appropriate variable */
  21.    interpret nextarg
  22.    end
  23.  
  24. /* Get a unique identifier */
  25. id = pragma('ID')
  26.  
  27. /* Create a temporary file. Add a HTML header first: */
  28. address command
  29. 'echo >t:dir_' || id '"<html><head><title>Directory of' drawer '</title></head>"'
  30. 'echo >>t:dir_' || id '"<body><h1>Directory of' drawer '</h1><pre>"'
  31.  
  32. /* Get the directory
  33.    dirsopt is either 'DIRS' or empty
  34.    allopt is either 'ALL' or empty */
  35. 'dir >>t:dir_' || id drawer dirsopt allopt
  36.  
  37. /* Load the temp file into AWeb.
  38.    Use the RELOAD switch to force the file to be reloaded */
  39. address
  40. 'open file://localhost/t:dir_' || id 'reload'
  41.  
  42.